# Copyright (c) Huawei Technologies Co., Ltd. 2023-2024. All rights reserved.

from datetime import datetime, timezone


from golden_seed_server.models.mysql import MysqlDB
from golden_seed_server.models.mysql import User as user


class UserManager:

    @staticmethod
    def get_userinfo_by_user_sub(user_sub):
        result = None
        try:
            with MysqlDB().get_session() as session:
                result = session.query(user).filter(
                    user.user_sub == user_sub).first()
        except Exception as e:
            return result
        return result